﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="RecipeList.aspx.vb" Inherits="mybaconrecipe.WebForm1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p>
       <h1>Recipe List</h1>
<p>&nbsp;</p>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
    DataSourceID="SqlDataSource1" DataKeyNames="REC_ID">
    <Columns>
        <asp:ImageField DataImageUrlField="REC_IMAGE" HeaderText="Recipe Image">
            <ControlStyle CssClass="RecListThumb" />
        </asp:ImageField>
        <asp:BoundField DataField="REC_NAME" HeaderText="Recipe Name" 
            SortExpression="REC_NAME" />
        <asp:BoundField DataField="REC_DESC" HeaderText="Recipe Description" 
            SortExpression="REC_DESC" />
        <asp:TemplateField HeaderText="Recipe Stars">
            <ItemTemplate>
                <%# getStars(Eval("REC_STARS"))%>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:HyperLinkField DataNavigateUrlFields="REC_ID" 
            DataNavigateUrlFormatString="RecipeDetail.aspx?ID={0}" Text="Read More" />
    </Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    ConnectionString="<%$ ConnectionStrings:recipeConnectionString %>" 
    ProviderName="<%$ ConnectionStrings:recipeConnectionString.ProviderName %>" 
    
    
        SelectCommand="SELECT [REC_IMAGE], [REC_NAME], [REC_STARS], [REC_DESC], [REC_ID] FROM [RECIPE]"></asp:SqlDataSource>
</p>
    <p>
    </p>
        <p>
    </p>
</asp:Content>
